package com.chuangjiangx.member.manager.common.excel;

import org.apache.poi.ss.usermodel.Workbook;

import java.util.List;

/**
 * excel操作工具类
 */
public class ExcelUtils {

    /**
     * 导出excel
     *
     * @param excelHeader excel表头信息
     * @param dataList    excel数据
     * @return 返回Workbook对象
     * @throws InterruptedException 导出线程同步失败时抛出该异常
     */
    public static Workbook export(ExcelHeader excelHeader, List<Object> dataList) throws InterruptedException {
        ExcelExport excelExport = new ExcelExport(excelHeader, new SimpleExcelData(dataList));
        excelExport.buildExcel();
        return excelExport.getWorkbook();
    }
}
